/**
 * Created by Administrator on 2017/2/11.
 */
import { Component,OnInit } from '@angular/core';
import { FacnologinService }  from './facnologin.serve';
import { Router, ActivatedRoute, Params } from '@angular/router';


@Component({
    moduleId: module.id,
    selector: 'my-nologin',
    templateUrl: 'factorynologin.html',
    providers:[FacnologinService]
})
export class NologinComponent implements OnInit{
    constructor(
      private route: ActivatedRoute,
      private router: Router,
      private facnologinService:FacnologinService
    ){}
    private facdetail='';
      private facdetailinfro='';
      private errorMessage:string;
    ngOnInit(){
      //获取工厂详情id
      this.route.params
        .subscribe(
          (params:Params)=>{this.facdetail= params['id'];}
        );
      //获取工厂详情信息
      let giveid = this.facdetail;
      console.log(giveid);
      this.facnologinService.facdet(giveid)
        .subscribe(
          res => {this.facdetailinfro = res['data'];
            console.log(this.facdetailinfro)
          },
          error =>this.errorMessage = <any>error
        )
    }
}
